<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Like
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: Global.php 2010-09-07 16:05 idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Like
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 */

class Like_Form_Admin_Global extends Engine_Form {
	public function init() {
		$this->setTitle ( 'like_Like Plugin Settings' )->setDescription ( 'like_FAN_FORM_ADMIN_GLOBAL_DESCRIPTION' )->setOptions ( array ('class' => 'he_likes_settings' ) );
		
		$module_path = Engine_Api::_ ()->getModuleBootstrap ( 'like' )->getModulePath ();
		$this->addPrefixPath ( 'Engine_Form_Decorator_', $module_path . '/Form/Decorator/', 'decorator' );
		
		$settings = Engine_Api::_ ()->getApi ( 'settings', 'core' );
		
		$this->addElement ( 'Text', 'like_profile_count', array ('label' => 'like_Profile Likes', 'description' => 'like_Count of profile likes', 'value' => $settings->getSetting ( 'like.profile_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_profile_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.profile_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_profile_count', 'like_profile_period' ), 'like_profile_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Like Profile Settings' ) );
		
		$this->addElement ( 'Text', 'like_likes_count', array ('label' => 'like_Member Likes', 'description' => 'like_Count of likes', 'value' => $settings->getSetting ( 'like.likes_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_likes_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.likes_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_likes_count', 'like_likes_period' ), 'like_likes_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Likes Settings' ) );
		
		$this->addElement ( 'Text', 'like_matches_count', array ('label' => 'like_Like Matches', 'description' => 'like_Count of matches', 'value' => $settings->getSetting ( 'like.matches_count', 9 ) ) );
		
		$this->addDisplayGroup ( array ('like_matches_count' ), 'like_matches_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'like_Like Matches' ) );
		
		$this->addElement ( 'Text', 'like_event_count', array ('label' => 'like_Most Liked Events', 'description' => 'like_Count of most liked events', 'value' => $settings->getSetting ( 'like.event_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_event_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.event_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_event_count', 'like_event_period' ), 'like_event_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Most Liked Events Settings' ) );
		
		$this->addElement ( 'Text', 'like_user_count', array ('label' => 'like_Most Liked Members', 'description' => 'like_Count of most liked users', 'value' => $settings->getSetting ( 'like.user_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_user_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.user_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_user_count', 'like_user_period' ), 'like_user_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Most Liked Users Settings' ) );
		
		$this->addElement ( 'Text', 'like_page_count', array ('label' => 'like_Most Liked Pages', 'description' => 'like_Count of most liked pages', 'value' => $settings->getSetting ( 'like.page_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_page_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.page_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_page_count', 'like_page_period' ), 'like_page_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Most Liked Pages Settings' ) );
		
		$this->addElement ( 'Text', 'like_group_count', array ('label' => 'like_Most Liked Groups', 'description' => 'like_Count of most liked groups', 'value' => $settings->getSetting ( 'like.group_count', 9 ) ) );
		
		$this->addElement ( 'Checkbox', 'like_group_period', array ('description' => 'like_Period Description', 'label' => 'like_Period Enable', 'value' => $settings->getSetting ( 'like.group_period', 1 ) ) );
		
		$this->addDisplayGroup ( array ('like_group_count', 'like_group_period' ), 'like_group_settings', array ('class' => 'he_setting_fieldset', 'legend' => 'Most Liked Groups Settings' ) );
		
		$this->addElement ( 'File', 'logo', array ('label' => 'like_Like Logo', 'description' => 'like_Pictures for Like Button and Like Box' ) );
		
		$this->logo->addValidator ( 'Extension', false, 'jpg,png,gif' );
		$this->logo->addDecorator ( 'LikeLogo', array () );
		
		// Add submit button
		$this->addElement ( 'Button', 'submit', array ('label' => 'Save Changes', 'type' => 'submit', 'ignore' => true ) );
	}
}